package com.sx.zongzhi.presenter;

import com.sx.zongzhi.MyApplication;
import com.sx.zongzhi.bean.CompanyBean;
import com.sx.zongzhi.modle.ApiManager;
import com.sx.zongzhi.net.BaseCallBack;
import com.sx.zongzhi.net.BaseResult;
import com.sx.zongzhi.view.ICompanyListView;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by XZY on 2017/11/30.
 * 获取主办/抄办单位的列表
 */
public class CompanyListPest {

    private ICompanyListView listView;

    public CompanyListPest(ICompanyListView listView) {
        this.listView=listView;
    }


    public void getCompanyList(String path,String issueStepId,String exceptIds,int page,int rows){
        Map<String,Object> map=new HashMap<>();
        map.put("sid", MyApplication.sid);
        map.put("issueStepId", issueStepId);
        map.put("exceptIds", exceptIds);
        map.put("page",page);
        map.put("rows",rows);
        new ApiManager().getCompanyList(path,map, new BaseCallBack<BaseResult<CompanyBean>>() {
            @Override
            public void onSuccess(BaseResult<CompanyBean> response) {
                listView.getCompanyList(response.getData());
            }
            @Override
            public void onFailures(String message) {
                listView.showError(message);
            }
        });
    }


}
